--This function is implemented in test_worker
local gearman=require("gearman")
x = gearman.caller("date")
print(x())

--This function is implemented in test_worker
x = gearman.caller("datecalls")
print(x())

x = gearman.caller("mrv_test")
local run = require("sandbox").run
local rv1, rv2, rv3 = run(x())
print(rv1)
print(rv2)
for k,v in pairs(rv3) do
	print(k,v)
end
	

--This function doesn't exist and will therefore timeout
local gm_rubbish = gearman.caller("dfhwlrghsla", 5)
do
	local status, val = pcall(gm_rubbish, "Some Data")
	if status == false then --was probably a timeout, but should really check val
		print("Deal with Timeout")
	else
		print("Function returned: " .. val)
	end
end
